import 'package:json_annotation/json_annotation.dart';
part 'customerList.g.dart';

@JsonSerializable()
class CustomerListResult {
  final bool success;
  final String message;
  final List<CustomerInfo> data;

  const CustomerListResult(
    this.success,
    this.message,
    this.data,
  );

  factory CustomerListResult.fromJson(Map json) =>
      _$CustomerListResultFromJson(json);
  Map toJson() => _$CustomerListResultToJson(this);
}

@JsonSerializable()
class CustomerInfo {
  final int id;
  final String name;

  CustomerInfo(
    this.id,
    this.name,
  );

  factory CustomerInfo.fromJson(Map json) => _$CustomerInfoFromJson(json);
  Map toJson() => _$CustomerInfoToJson(this);
}
